<%-- 
    Document   : bookEditor
    Created on : 21.6.2014, 23:31:51
    Author     : Michal Ďuriš
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../../jspf/resources.jspf" %>

        <title>Editor kníh</title>
    </head>
    <body>

        <%@include file="../../jspf/header.jspf" %>

        <fieldset>
            <legend>
                <c:choose>
                    <c:when test="${not empty book.id}">
                        Zmeniť knihu
                    </c:when>
                    <c:otherwise>
                        Pridať knihu
                    </c:otherwise>
                </c:choose>
            </legend>

            <form:form commandName="book">

                <%@include file="../../jspf/forms/bookForm.jspf" %>

                <div class="editorButtonsContainer" >
                    <input type="submit" value="ulož" />

                    <input type="button" value="späť" 
                           onclick="location.href = '<c:url value="/viewdata?userID=${param['userID']}" />'" />
                </div>
            </form:form>
        </fieldset>

        <%@include file="../../jspf/footer.jspf" %>

    </body>
</html>
